package com.web.service.impl;

import com.web.dao.UserDAO;
import com.web.dao.impl.UserDAOImpl;
import com.web.entity.User;
import com.web.service.UserService;

/**
 * @author lenovo
 * @Description
 * @Date2025-2-28 15:40
 */
public class UserServiceImpl implements UserService {
    private UserDAO userDAO=new UserDAOImpl();

    @Override
    public User login(String username,String password){
        User user=userDAO.selectUserByUsername(username);
        if(user!=null){
            if(password.equals(user.getPassword())){
                return user;
            }
        }
        return null;
    }
    @Override
    public void updateUser(User user) {
        userDAO.updateUser(user);
    }
}
